﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace Ocean.His.MedicalInsurance.Tool.Models
{
    /// <summary>
    /// 购药信息
    /// </summary>
    [DataContract]
    public class SI2101Druginfo
    {
        /// <summary>
        /// 人员编号
        /// Y
        /// </summary>
        [DataMember(Name = "psn_no")]
        public string PsnNo { get; set; }

        /// <summary>
        /// 就诊凭证类型
        /// Y
        /// </summary>
        [DataMember(Name = "mdtrt_cert_type")]
        public string MdtrtCertType { get; set; }

        /// <summary>
        /// 就诊凭证编号
        /// Y
        /// </summary>
        [DataMember(Name = "mdtrt_cert_no")]
        public string MdtrtCertNo { get; set; }

        /// <summary>
        /// 开始时间
        /// Y
        /// </summary>
        [DataMember(Name = "begntime")]
        public string Begntime { get; set; }

        /// <summary>
        /// 医疗费总额
        /// Y
        /// </summary>
        [DataMember(Name = "medfee_sumamt")]
        public decimal MedfeeSumamt { get; set; }

        /// <summary>
        /// 险种类型
        /// Y
        /// </summary>
        [DataMember(Name = "insutype")]
        public string Insutype { get; set; }

        /// <summary>
        /// 病种编码
        /// </summary>
        [DataMember(Name = "dise_codg")]
        public string DiseCodg { get; set; }

        /// <summary>
        /// 病种名称
        /// </summary>
        [DataMember(Name = "dise_name")]
        public string DiseName { get; set; }

        /// <summary>
        /// 个人账户使用标志
        /// Y
        /// </summary>
        [DataMember(Name = "acct_used_flag")]
        public string AcctUsedFlag { get; set; }

        /// <summary>
        /// 医疗类别
        /// Y
        /// </summary>
        [DataMember(Name = "med_type")]
        public string MedType { get; set; }

        /// <summary>
        /// 字段扩展
        /// </summary>
        [DataMember(Name = "exp_content")]
        public string ExpContent { get; set; }

        public SI2101Druginfo()
        {

        }
    }

    /// <summary>
    /// 购药明细信息
    /// </summary>
    [DataContract]
    public class SI2101Drugdetail
    {
        /// <summary>
        /// 费用明细流水号
        /// </summary>
        [DataMember(Name = "feedetl_sn")]
        public string FeedetlSn { get; set; }

        /// <summary>
        /// 处方号
        /// </summary>
        [DataMember(Name = "rxno")]
        public string Rxno { get; set; }

        /// <summary>
        /// 外购处方标志
        /// </summary>
        [DataMember(Name = "rx_circ_flag")]
        public string RxCircFlag { get; set; }

        /// <summary>
        /// 费用发生时间
        /// </summary>
        [DataMember(Name = "fee_ocur_time")]
        public string FeeOcurTime { get; set; }

        /// <summary>
        /// 医疗目录编码
        /// </summary>
        [DataMember(Name = "med_list_codg")]
        public string MedListCodg { get; set; }

        /// <summary>
        /// 医药机构目录编码
        /// </summary>
        [DataMember(Name = "medins_list_codg")]
        public string MedinsListCodg { get; set; }

        /// <summary>
        /// 明细项目费用总额
        /// </summary>
        [DataMember(Name = "det_item_fee_sumamt")]
        public decimal DetItemFeeSumamt { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        [DataMember(Name = "cnt")]
        public decimal Cnt { get; set; }

        /// <summary>
        /// 单价
        /// </summary>
        [DataMember(Name = "pric")]
        public decimal Pric { get; set; }

        /// <summary>
        /// 单次剂量描述
        /// </summary>
        [DataMember(Name = "sin_dos_dscr")]
        public string SinDosDscr { get; set; }

        /// <summary>
        /// 使用频次描述
        /// </summary>
        [DataMember(Name = "used_frqu_dscr")]
        public string UsedFrquDscr { get; set; }

        /// <summary>
        /// 周期天数
        /// </summary>
        [DataMember(Name = "prd_days")]
        public decimal PrdDays { get; set; }

        /// <summary>
        /// 用药途径描述
        /// </summary>
        [DataMember(Name = "medc_way_dscr")]
        public string MedcWayDscr { get; set; }

        /// <summary>
        /// 开单医生编码
        /// </summary>
        [DataMember(Name = "bilg_dr_codg")]
        public string BilgDrCodg { get; set; }

        /// <summary>
        /// 开单医师姓名
        /// </summary>
        [DataMember(Name = "bilg_dr_name")]
        public string BilgDrName { get; set; }

        /// <summary>
        /// 中药使用方式
        /// </summary>
        [DataMember(Name = "tcmdrug_used_way")]
        public string TcmdrugUsedWay { get; set; }

        public SI2101Drugdetail()
        {

        }
    }

    /// <summary>
    /// 
    /// </summary>
    [DataContract]
    public class SI2101InputModel
    {
        /// <summary>
        /// 购药信息
        /// </summary>
        [DataMember(Name = "druginfo")]
        public SI2101Druginfo Druginfo { get; set; }

        /// <summary>
        /// 购药明细信息
        /// </summary>
        [DataMember(Name = "drugdetail")]
        public List<SI2101Drugdetail> Drugdetail { get; set; }
    }

    /// <summary>
    /// 2101A预结算入参
    /// </summary>
    [DataContract]
    public class SI2101RequestModel : SIBaseRequestModel
    {
        /// <summary>
        /// 交易输入
        /// </summary>
        [DataMember(Name = "input")]
        public SI2101InputModel Input { get; set; }

        public SI2101RequestModel(MedicalInsuranceOption medicalInsuranceOption) : base(medicalInsuranceOption)
        {
            Infno = "2101";
        }
    }
}
